package com.heima.api.schedule;

import com.heima.model.admin.dots.ChannelDto;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.NewsAuthDto;
import com.heima.model.wemedia.dtos.SensitiveDto;
import com.heima.model.wemedia.pojos.WmChannel;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.model.wemedia.pojos.WmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 王梓聪
 */
@FeignClient(value = "leadnews-wemedia")
public interface WemediaFeign {

    @PostMapping("/api/v1/channel/list")
    PageResponseResult wemediaList(@RequestBody ChannelDto dto);

    @PostMapping("/api/v1/channel/save")
    ResponseResult saveChannel(@RequestBody WmChannel channel);

    @GetMapping("/api/v1/channel/del/{id}")
    ResponseResult deleteById(@PathVariable Integer id);

    @GetMapping("/api/v1/channel/update")
    ResponseResult updateChannel(@RequestBody WmChannel channel);

    @PostMapping("/api/v1/sensitive/list")
    PageResponseResult sensitiveList(@RequestBody SensitiveDto dto);

    @PostMapping("/api/v1/sensitive/save")
    ResponseResult saveSensitive(WmSensitive sensitive);

    @DeleteMapping("api/v1/sensitive/del/{id}")
    ResponseResult deleteSensitiveById(@PathVariable Integer id);

    @PostMapping("api/v1/sensitive/update")
    ResponseResult updateSensitive(@RequestBody WmSensitive sensitive);

    /**
     * 文章审核分页查询
     * @param newsAuthDto
     * @return
     */
    @PostMapping("/list_vo")
    PageResponseResult newsAuthList(@RequestBody NewsAuthDto newsAuthDto);


    /**
     * 查询文章详情
     * @param id
     * @return
     */
    @GetMapping("/one_vo/{id}")
    ResponseResult queryNewsOne(@PathVariable Integer id );

    /**
     * 文章审核失败
     * @param newsAuthDto
     * @return
     */
    @PostMapping("/auth_fail")
    ResponseResult authFail(@RequestBody NewsAuthDto newsAuthDto);


    /**
     * 文章审核成功
     * @param newsAuthDto
     * @return
     */
    @PostMapping("/auth_pass")
    ResponseResult authPass(@RequestBody NewsAuthDto newsAuthDto);

    @PostMapping("/all")
    List<String> selectAllSensitive(@RequestBody SensitiveDto dto);

    @GetMapping("/jjjj")
    public WmUser selectByIdd(@RequestParam Integer authorId);
}
